package Ptolemaiosz;

public class PhysicalEntity {

	private Vector velocity;
	private Vector position;
	private Polygon polygon;
	private LevelPartManager levelPartManager;

    public PhysicalEntity() {
        
		SkeletonLogger.logCall();
		
		SkeletonLogger.logReturn();
    }
        
        

	public Vector getPosition() {
		
		
		SkeletonLogger.logCall();
		
		SkeletonLogger.logReturn();
		
		return this.position;
	}

	/**
	 * 
	 * @param c
	 */
	public void collision(PhysicalEntity c) {
		SkeletonLogger.logCall();
		
		SkeletonLogger.logReturn();
	}

	/**
	 * 
	 * @param deltaTime
	 */
	public void update(long deltaTime) {
		SkeletonLogger.logCall();
		
                //Lekerdezzuk a sajat tulajdonsagainkat
                getVelocity();
                getPosition();
                
                //Ezek alapjan eldontjuk uj palyaszakszra lepnenk-e a kovetkezo idopillanatban
                 if(SkeletonController.question("Az objektum uj palyaszakaszra lepne?"))
                     {
                         //Ha igen:
                         SkeletonLogger.disable();
                         SkeletonLogger.logRef("ILLESZKEDES VISZGALAT (default ANSW=NO)");
                         //Megnezzuk illeszkedik-e a ket palyaszakasz
                         if(getLevelPartManager().matchChecker(Direction.down));
                             {
                                 //Ha igen onnantol a masik lesz az aktualis, mert atleptunk! (De mi van, ha nem az avatar lepett at?)
                                 //Itt majd elkerulhetetlen lesz egy reflecionos vizsgalat
                                 levelPartManager.getLevel().setCurrentLevelPart(null);
                             }
                        SkeletonLogger.enable();
                            
                     }
                 
                 //Beallitjuk az uj tulajdonsagainkat az elozmenyek fuggvenyeben
                 setPosition(null);
                 addVelocity(null);
		
		SkeletonLogger.logReturn();
	}

	public Polygon getPolygon() {
		
		
		SkeletonLogger.logCall();
		
		SkeletonLogger.logReturn();
		
		return this.polygon;
	}

	/**
	 * 
	 * @param velocity
	 */
	public void addVelocity(Vector velocity) {
		SkeletonLogger.logCall();
		
			
		SkeletonLogger.logReturn();
	}

	/**
	 * 
	 * @param direction
	 */
	public void move(Direction direction) {
		SkeletonLogger.logCall();
		
			this.addVelocity(null);
                        
		SkeletonLogger.logReturn();
	}

	public Vector getVelocity() {
		
		
		SkeletonLogger.logCall();
		
		SkeletonLogger.logReturn();
		
		return this.velocity;
	}

	public void setPosition(Vector v) {
		SkeletonLogger.logCall();
                
                this.position = v;
	
		SkeletonLogger.logReturn();
	}
        
        /*
         * 
         * 
         */
        public void setPolygon() {
		SkeletonLogger.logCall();	
		SkeletonLogger.logReturn();
	}

	public LevelPartManager getLevelPartManager() {
		
		
		SkeletonLogger.logCall();
		
		SkeletonLogger.logReturn();
		
		return this.levelPartManager;
	}

	/**
	 * 
	 * @param levelPartManager
	 */
	public void setLevelPartManager(LevelPartManager levelPartManager) {
		SkeletonLogger.logCall();
		
		SkeletonLogger.logReturn();
		
		this.levelPartManager = levelPartManager;
	}

}